package com.google.tools;

/**
 * 查找输入的数的索引，如果没有返回 -1
 * @author Mucd
 * @Date 2020/12/17
 * @Class Num
 */
public class GetIndex {
    public static int getIndex(int[] arr,int j){
        int index = -1;
        for (int i = 0;i<arr.length;i++){
            if (j == arr[i]){
                index = i;
                break;
            }
        }
        return index;
    }
}
